app.controller("rootctrl",function($scope){
	$scope.tile="登录";
	$scope.tile2="注册";
});
app.controller("logctrl",function($scope,getUserByName){
	$scope.loginbtn=function(){
		getUserByName.login($scope.username,$scope.pwd).then(function (response) {
			console.log(response);
			if("Y"==response.data.rs){
				alert("登录成功");
			}else{
				alert(response.data.reason);
			}
		});
	}
});

app.controller("registerctrl",function($scope,addUser){
	$scope.registerbtn=function(){
		addUser.add($scope.username,$scope.pwd).then(function (response) {
			console.log(response);
			if("Y"==response.data.rs){
				alert("注册成功");
			}else{
				alert(response.data.reason);
			}
		});
	}
});